Skip to content

Conversation

@dengzhhu653
Copy link
Member

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

@dengzhhu653
Copy link
Member Author

cc @wecharyu @saihemanth-cloudera could you take a look if have secs? thank you!

Class<? extends TBase> requestBody();
boolean supportAsync() default false;
String id() default "getId";
String cancel() default "isCancel";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id and cancel is from request, it seems a little strange to set get such annotations for handler.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when creating the handler, it knows what the request is, and how to get the async id from the request at the definition.

private Future<Result> executeRequest() {
Timer.Context timerContext;
if (StringUtils.isNotEmpty(getMetricAlias())) {
Timer timer = Metrics.getOrCreateTimer(MetricsConstants.API_PREFIX + getMetricAlias());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will multi reflection calls affect the performance?

Copy link
Member Author

@dengzhhu653 dengzhhu653 Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just a simple call, no reflection here

} finally {
super.afterExecute(result);
if (async) {
rs.shutdown();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why cleanup rs here? it will be cleaned if connection is closed in HMSHandler.cleanupHandlerContext().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, if this handler is running in background thread, HMSHandler.cleanupHandlerContext() will just clean the main thread which creates this backed thread.

} finally {
super.afterExecute(result);
if (async) {
ms.shutdown();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants